

import grails.test.mixin.*
import grails.test.mixin.support.*
import grails.test.mixin.web.UrlMappingsUnitTestMixin

import org.junit.*

import ru.vba.kitchen.model.PictureController

/**
 * See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
 */
@Mixin(UrlMappingsUnitTestMixin)
@TestFor(UrlMappings)
@Mock(PictureController)
class UrlMappingsTests {

	void testRenderImageUrlMapping() {
		assertForwardUrlMapping("/picture/tag_thumb_1.jpg", controller : 'picture' , action : 'image'){
			object = 'tag'
			type = 'thumb'
			id = '1'
		}
		shouldFail {
			assertForwardUrlMapping("/image/tag_thumb_1.jpg", controller : 'picture' , action : 'image'){
				object = 'tag'
				type = 'thumb'
				id = '1'
			}
		}
	}
}
